# ===== root/game.py

# ---------- in __ServerCommand_Build(): inregistrare comenzi BP_* (liniile 2602-2609)
		# bpass
		serverCommandList["BP_CLEAR"] = self.BattlePassClear
		serverCommandList["BP_ACTIVATED"] = self.BattlePassActive
		serverCommandList["BP_UPDATE"] = self.BattlePassUpdate
		serverCommandList["BP_INFO"] = self.BattlePassInfo
		serverCommandList["BP_INFOR"] = self.BattlePassInfoReward
		serverCommandList["BP_INFOG"] = self.BattlePassInfoGeneral
		serverCommandList["BP_SHOP_COIN"] = self.ShowShopCoinBattlePass

# ---------- metode noi in clasa GameWindow (liniile 3434-3464)
	def BattlePassActive(self, isPremium):
		if int(isPremium) == 1:
			self.interface.wndBattlePass.UnlockPremium()

	def BattlePassUpdate(self, index, count, exp, totalExp, level, coolTime):
		self.interface.wndBattlePass.SetExperience(int(exp), int(totalExp))
		self.interface.wndBattlePass.SetLevel(int(level))
		self.interface.wndBattlePass.UpdateMission(int(index), int(count), int(coolTime))
	
	def BattlePassInfo(self, category, index, title, type, vnum, count, maxCount, expRecv, isPremium, coolTime):
		self.interface.wndBattlePass.AppendMission(int(category), int(index), title, int(type), int(vnum), int(count), int(maxCount), int(expRecv), int(isPremium), int(coolTime))
		
	def BattlePassInfoReward(self, index, vnum, count, iNecessaryLevel, status, isPremium):
		self.interface.wndBattlePass.AppendRewardItem(int(index), int(vnum), int(count), int(status), int(isPremium), int(iNecessaryLevel))

	def BattlePassInfoGeneral(self, isPremium, monthBattlePass, EXP, totalEXP, level, coins):
		if int(isPremium) == 1:
			self.interface.wndBattlePass.UnlockPremium()
			
		self.interface.wndBattlePass.SetExperience(int(EXP), int(totalEXP))
		self.interface.wndBattlePass.SetLevel(int(level))
		
		# constInfo.BATTLE_PASS_COINS = int(coins)

	def ShowShopCoinBattlePass(self):
		self.interface.dlgShop.wndTextBattlePassCoin.Show()
		self.interface.dlgShop.btnBuy.Hide()
		self.interface.dlgShop.btnSell.Hide()
	
	def BattlePassClear(self):
		self.interface.wndBattlePass.ClearBattlePass()
